package com.ziJing.multithreading.sync.t_04_ReentrantLock;

import java.util.concurrent.locks.ReentrantLock;

/**
 * @program Multithreading
 * @description:
 * @author: zhangbo
 * @create: 2022/05/08 23:37
 */
public class T14_Reentrantlock {

    static ReentrantLock lock = new ReentrantLock(true);

    static int a = 0;

    public static void main(String[] args) {
        lock.lock();
        try{
            a++;
        } finally {
            lock.unlock();
        }

    }
}
